<?php
    use yii\helpers\Html;
    use yii\helpers\Url;
    use yii\widgets\LinkPager;
    use yii\bootstrap\ActiveForm;
?>
<div style="margin: 15px 0px;">
<?php $form = ActiveForm::begin()?>
    <?=$form->field($data['search'],'name', ['inputOptions' => ['placeholder'=>'姓名查询','class' => 'form-control', 'style' => 'width:30%; float:left; margin-right:30px;']])->textInput()->label(false);?>
    <?=$form->field($data['search'],'phone', ['inputOptions' => ['placeholder'=>'手机号码查询','class' => 'form-control', 'style' => 'width:30%; float:left; margin-right:30px;']])->textInput()->label(false);?>
    <?=Html::submitButton('查询',['class'=>'btn btn-primary', 'style' => 'width:10%; float:left']); ?> 
<?php ActiveForm::end(); ?>
<div style="clear: both;"></div>
</div> 
<table class="table table-striped">
  <thead>
    <tr>
      <th>ID</th>
      <th>姓名</th>
      <th>性别</th>
      <th>联系方式</th>
      <th>记录时间</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
    <?php foreach ($data['lists'] as $key => $value) {?>
    <tr>
      <th scope="row"><?=$value['id']?></th>
      <td><?=$value['name']?></td>
      <td><?=$value['sex']?></td>
      <td><?=$value['phone']?></td>
      <td><?=Yii::$app->formatter->asDateTime($value['time']);?></td>
      <td>
        <?php if($value['status'] == 0){?>
            <a href="<?=Url::to(['test/set-status', 'id' => $value['id'], 'value' => 1])?>" class="btn btn-info">查　看</a>
        <?php }else{?>
            <a href="<?=Url::to(['test/set-status', 'id' => $value['id'], 'value' => 0])?>" class="btn btn-warning">已查看</a>
        <?php }?>
        <a href="<?=Url::to(['test/del', 'id' => $value['id']])?>" class="btn btn-danger">删　除</a>
        </td>
    </tr>
    <?php }?>
  </tbody>
</table>
<?= LinkPager::widget(['pagination' => $data['page']]); ?>